package com.itcast.mapper;

import com.itcast.pojo.Collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2020-06-19
 */
@Repository
@Mapper
public interface CollectMapper extends BaseMapper<Collect> {
    List<Collect> selectcollectionfenye(int uid);

    /**
     * 根据角色ID查收藏列表
     * @param userId
     * @return
     */
    @Select(value = "SELECT * FROM collect WHERE userId = #{userId}")
    List<Collect> selectByUserId(@Param("userId") String userId);

}
